import java.util.Random;

public class lab_01 {
    public static void main(String[] args) {
        Random random = new Random();
        System.out.println("50道100以内的加减法口算练习题：\n");
        
        for (int i = 1; i <= 50; i++) {
            // 随机生成两个1-100之间的数
            int num1 = random.nextInt(100) + 1;
            int num2 = random.nextInt(100) + 1;
            
            // 随机选择加法(0)或减法(1)
            int operation = random.nextInt(2);
            
            if (operation == 0) {
                // 加法：确保结果不超过200
                System.out.println(i + ". " + num1 + " + " + num2 + " = ");
            } else {
                // 减法：确保被减数大于减数，结果非负
                if (num1 < num2) {
                    // 交换两个数，确保结果非负
                    int temp = num1;
                    num1 = num2;
                    num2 = temp;
                }
                System.out.println(i + ". " + num1 + " - " + num2 + " = ");
            }
            
            // 每10题空一行，提高可读性
            if (i % 10 == 0 && i < 50) {
                System.out.println();
            }
        }
    }
}